// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1

Image {
    id: mainmenubutton
    property bool activ: false
    property variant action

    source: "./images/button_" + action.iconText + "_" + (activ ? "active" : "default") + ".png"

    MouseArea{
        anchors.fill: parent
        hoverEnabled: true
        onEntered: mainmenubutton.state = "hover";
        onExited: mainmenubutton.state = "";
        onClicked: { action.trigger() }
    }

    states: [
        State {
            name: "hover"
            PropertyChanges { target: mainmenubutton; source: "./images/button_" + action.iconText + "_" + "hover.png"}
        }
    ]
}
